package com.giscloud;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import lombok.extern.log4j.Log4j2;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;
import java.sql.SQLException;

/**
 * 服务的入口类
 * 
 * @author gxd
 * @email gxd@gxdgroup.cindata.cn
 * @date 2019-11-29 09:23:08
 */
@Log4j2
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@MapperScan(basePackages = "com.giscloud.*.dao")
@EnableTransactionManagement
public class Application {
    public static void main(String[] args) {
        log.error("giscloud服务开始启动。。。。。。");
        ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
        Environment environment = context.getBean(Environment.class);
        log.error("giscloud服务启动成功,访问链接：http://127.0.0.1:"+environment.getProperty("server.port"));
    }
}
